/* Author : Maisa Nurul Agnia */
package jtk.project4.fleet.field;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;
import nl.coderight.jazz.form.field.button.PushButton;

public class PartsToOrderField extends GroupControl {
	private TableField<String>  partsToOrderTable;
	private PushButton tambahField;
	
	public PartsToOrderField(String bindID){
		//setTitle("header.PurchasedFrom(Vendor)"); //disesuaikan dengan nama field
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	public void createFields()
	{
		partsToOrderTable = new TableField<String>("partsToOrder","partsToOrder");
	//	partsToOrderTable.setTitle("partsToOrderTable.header");
		partsToOrderTable.setAutoResizeMode(AutoResizeMode.ALL_COLUMNS);
		partsToOrderTable.getSelectionValues();
		
		partsToOrderTable.addColumn("label.Quantity","quantity");
		partsToOrderTable.addColumn("label.Part#","part");
		partsToOrderTable.addColumn("label.Name","name");
		partsToOrderTable.addColumn("label.UnitCost","uCost");
		partsToOrderTable.addColumn("label.ExtendedCost","eCost");
		partsToOrderTable.addColumn("label.ReorderQuantity","reQuantity");//Table.addColumn("label.qty","qty");
		partsToOrderTable.addColumn("label.Comments","comment");
		
		tambahField = new PushButton("AddAction");

	}
	
	public void createLayout()
	{
		addField(createFieldGroup(),CENTER);
		
		
	}
	
	private GroupControl createFieldGroup(){
		GroupControl fieldGroup=new GroupControl();
		fieldGroup.addField(partsToOrderTable,CENTER);
		return fieldGroup;
	}
}
